package com.cby.operation.login.data

import android.os.Parcel
import android.os.Parcelable

data class InternalTip(

    /**
     * 对话框内容
     */
    var tipContent: String?,

    /**
     * 消极按钮文案
     */
    var negativeBtnName: String?,

    /**
     * 消极按钮事件
     */
    var negativeBtnAction: Int,

    /**
     * 积极按钮文案
     */
    var positiveBtnName: String?,

    /**
     * 积极按钮事件
     */
    var positiveBtnAction: Int
): Parcelable{
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(tipContent)
        parcel.writeString(negativeBtnName)
        parcel.writeInt(negativeBtnAction)
        parcel.writeString(positiveBtnName)
        parcel.writeInt(positiveBtnAction)
    }

    override fun describeContents(): Int {
        return 0
    }


    companion object CREATOR : Parcelable.Creator<InternalTip> {
        override fun createFromParcel(parcel: Parcel): InternalTip {
            return InternalTip(parcel)
        }

        override fun newArray(size: Int): Array<InternalTip?> {
            return arrayOfNulls(size)
        }
    }

    override fun toString(): String {
        return "InternalTip(tipContent=$tipContent, negativeBtnName=$negativeBtnName, negativeBtnAction=$negativeBtnAction, positiveBtnName=$positiveBtnName, positiveBtnAction=$positiveBtnAction)"
    }
}
